package com.yhn.init.model.dto.purchase;

import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serial;
import java.io.Serializable;

/**
 * @author yhn
 * @version 1.0
 * @description
 * @date 2024/3/22 10:45
 */

@Data
public class PurchaseAddRequest implements Serializable {

    /**
     * 物品ID
     */
    @NotNull(message = "物品ID不能为空")
    private Long itemId;

    /**
     * 入库数量
     */
    @NotNull(message = "入库数量不能为空")
    @Min(value = 1, message = "入库数量必须大于等于1")
    private Integer quantity;

    /**
     * 物品类型
     */
    @NotNull(message = "物品类型不能为空")
    @Min(value = 1, message = "物品类型必须大于等于1小于等于2")
    @Max(value = 2, message = "物品类型必须大于等于1小于等于2")
    private Integer type;

    @Serial
    private static final long serialVersionUID = 1L;
}
